import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        component: Index,
        children: [{
                path: '/',
                name: 'Home',
                component: () =>
                    import ( /* webpackChunkName: "Home" */ '../views/Home.vue')
            },
            {
                path: '/category',
                name: 'Category',
                component: () =>
                    import ( /* webpackChunkName: "category" */ '../views/Category.vue')
            },
            {
                path: '/user',
                name: 'User',
                component: () =>
                    import ( /* webpackChunkName: "User" */ '../views/User.vue')
            },
            {
                path: '/cart',
                name: 'Cart',
                component: () =>
                    import ( /* webpackChunkName: "Cart" */ '../views/Cart.vue')
            },
        ]
    },
    {
        path: '/login',
        name: 'Login',
        component: () =>
            import ( /* webpackChunkName: "login" */ '../views/Login.vue')
    },
    {
        path: '/echart',
        name: 'echartPage',
        component: () =>
            import ( /* webpackChunkName: "echartPage" */ '../views/echartsList/echartPage.vue')
    },
    {
        path: '/address',
        name: 'Address',
        component: () =>
            import ( /* webpackChunkName: "Address" */ '../views/Address.vue')
    },
    {
        path: '/addressedit',
        name: 'Addressedit',
        component: () =>
            import ( /* webpackChunkName: "Addressedit" */ '../views/AddressEdit.vue')
    },
    {
        path: '/create_order',
        name: 'create_order',
        component: () =>
            import ( /* webpackChunkName: "create_order" */ '../views/CreateOrder.vue')
    },
    {
        path: '/order',
        name: 'order',
        component: () =>
            import ( /* webpackChunkName: "corder" */ '../views/Order.vue')
    },
    {
        path: '/orderDetail/:orderId',
        name: 'orderDetail',
        component: () =>
            import ( /* webpackChunkName: "orderDetail" */ '../views/OrderDetail.vue')
    },
    {
        path: '/product/:goodsId',
        name: 'product',
        component: () =>
            import ( /* webpackChunkName: "product" */ '../views/Product.vue')
    },
    {
        path: '/setting/',
        name: 'setting',
        component: () =>
            import ( /* webpackChunkName: "setting" */ '../views/Setting.vue')
    },
    {
        path: '/search/',
        name: 'search',
        component: () =>
            import ( /* webpackChunkName: "search" */ '../views/Search.vue')
    },
]

const router = new VueRouter({
    mode: 'history',
    linkActiveClass: 'current',
    linkExactActiveClass: 'current-exact',
    // base: ProcessingInstruction.env.BASE_URL,
    routes
})

export default router